package com.tairanchina.md.meeting;

import java.io.IOException;
import java.net.URI;

import com.tairanchina.md.meeting.application.MeetingApplication;
import org.glassfish.grizzly.http.server.HttpServer;
import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;


/**
 * @description
 * @author xuxw
 * @time 2016年4月25日下午2:30:45
 */
public class Main
{

	//本地启动服务11
    public static final String BASE_URI = "http://localhost:8080/yearmeeting/rest";

    public static void main(String[] args) throws IOException
    {

        HttpServer httpServer = startServer();
        System.out.println(String.format("Jersey app started with WADL available at "
                                         + "%sapplication.wadl\nHit enter to stop it...",
                                         BASE_URI, BASE_URI));
        System.in.read();
        httpServer.shutdownNow();
    }

    public static HttpServer startServer()
    {
        System.out.println("start server...");
        MeetingApplication config = new MeetingApplication();
        return GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), config);
    }

}
